package com.servlet;

import com.Dao.AdminDao;
import com.bean.AdminBean;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.ArrayList;

@WebServlet(name = "UserServlet", value = "/UserServlet")
public class UserServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        response.setContentType("text/html;charset=UTF-8");
        HttpSession session=request.getSession();
        AdminDao adminDao=new AdminDao();
        ArrayList<AdminBean> list = new ArrayList<AdminBean>();
        list=adminDao.get_ListInfo();
        session.setAttribute("list2",list);
        response.sendRedirect("user_massage.jsp");
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
